package com.byb.server.service.dto.Wc;

import com.byb.server.service.dto.WcInsuranceCategoryDTO;
import com.byb.server.service.dto.WcInsuranceTypeDTO;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class WcITDTO implements Serializable {

    private Long id;

    private String name;

    private String info;

    private List<WcInsuranceCategoryDTO> wcInsuranceCategoryDTOList =new ArrayList<>();

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public List<WcInsuranceCategoryDTO> getWcInsuranceCategoryDTOList() {
        return wcInsuranceCategoryDTOList;
    }

    public void setWcInsuranceCategoryDTOList(List<WcInsuranceCategoryDTO> wcInsuranceCategoryDTOList) {
        this.wcInsuranceCategoryDTOList = wcInsuranceCategoryDTOList;
    }

    public void setWcInsuranceCategoryDTO(WcInsuranceCategoryDTO wcInsuranceCategoryDTO){
        this.wcInsuranceCategoryDTOList.add(wcInsuranceCategoryDTO);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        WcInsuranceTypeDTO wcInsuranceTypeDTO = (WcInsuranceTypeDTO) o;
        if(wcInsuranceTypeDTO.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), wcInsuranceTypeDTO.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

}
